<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>签到历史</title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
	<link href="../../../css/mui.css" rel="stylesheet"/>
	<link href="../../../css/app.css" rel="stylesheet"/>
	<style type="text/css">
		.app-fs30 {
			font-size: 30px;
		}
	</style>
</head>
<body>
	<!-- 头部HEADER -->
	<header class="mui-bar mui-bar-nav">
		<span class="mui-icon mui-icon-back" 
			onclick="jumpToMy()"></span>
		<h1 class="mui-title">
			<span onclick="jumpToMySignAdd()">签到</span>
			&nbsp; 
			<b>历史</b>
		</h1>
	</header>
	<!-- 头部HEADER -->
	
	<!-- 主体布局 -->
	<div style="height: 45px;"></div>
	<ul class="mui-table-view" id="refresh"> 
	</ul>
	<!-- 没有数据 -->
	<p id="nodata"></p>
	<br><br>
	<!-- 主体布局 -->
	
	<!-- 底部菜单 -->
	<nav class="mui-bar mui-bar-tab">
		<a class="mui-tab-item" onclick="jumpToIndex()">
			<span class="mui-icon mui-icon-home"></span>
			<span class="mui-tab-label">首页</span>
		</a>
		<a class="mui-tab-item" onclick="jumpToMarket()">
			<span class="mui-icon mui-icon-download"></span>
			<span class="mui-tab-label">库</span>
		</a>
<!-- 		<a class="mui-tab-item" onclick="jumpToChat()">
			<span class="mui-icon mui-icon-chatbubble"></span>
			<span class="mui-tab-label">消息</span>
		</a> -->
		<a class="mui-tab-item mui-active" onclick="jumpToMy()">
			<span class="mui-icon mui-icon-contact"></span>
			<span class="mui-tab-label">我的</span>
		</a>
	</nav>
	<!-- 底部菜单 -->
</body>
</html>


<script src="../../../js/mui.js"></script>
<script src="../../../js/app.js"></script>
<script type="text/javascript">
	// 初始化
	mui.init({
		//下拉、上拉刷新
        pullRefresh: {
            container: "#refresh",
            down: { //下拉刷新
				style: "circle",
				height: 50,
				auto: true,
                contentrefresh: "正在加载...",
                contentnomore: '没有更多了',
                callback: async function () { 
					getIndex();
					mui('#refresh').pullRefresh().endPulldownToRefresh();
                }
            }
        }
    });
	//自动加载
	mui.plusReady(function () {
		(function($, owner) {
			getIndex(); 
		}(mui, window.app = {}));
	});
	//获取列表
	function getIndex(){
		var resList = getSignCache();
		var list = resList.list;
		var h = '', i = 0, title = '';
		if (!list || list.length==0) {
			h += '<li class="mui-table-view-cell mui-collapse">';
			h += '<a class="mui-navigate-right">';
			h += '<span>签到。。</span>';
			h += '<span class="app-list-right">奖励 0</span>';
			h += '</a>';
			h += '<div class="mui-collapse-content">';
			h += '<p>奖励金币。。。</p>';
			h += '</div>';
			h += '</li>';
			mui("#refresh")[0].innerHTML = h;
			return
		}
		for (i=0;i<list.length;i++) {
			h += '<li class="mui-table-view-cell mui-collapse">';
			h += '<a class="mui-navigate-right">';
			h += '<span>签到时间：'+list[i].signDate+'</span>';
			h += '<span class="app-list-right">奖励</span>';
			h += '</a>';
			h += '<div class="mui-collapse-content">';
			h += '<p>恭喜您，获得 0 金币</p>';
			h += '</div>';
			h += '</li>';
		}
		mui("#refresh")[0].innerHTML = h;
	}
	// 获取缓存
	function getSignCache(){
		var resList = cacheGet(signList);
		if (!resList) {
			var list = new Array(),  //数据数组
				idstring = ''; //ID字符串集合
			return {
				// 数据数组
				list: list,
				// 历史ID集合
				idstr: idstring
			};
		}
		return resList;
	}
</script>